package com.java01.file.filesystem;

import java.io.File;

public class DiskSpace {

	public static void main(String[] args) {
		for(File disk:File.listRoots()){

			long free = disk.getFreeSpace();
			long total = disk.getTotalSpace();
			
			if(total==0)
				continue;
			
			long percentage = free*100/total;
			
			System.out.println("Disk "+disk+" "+percentage+"% left");
			
		}
	}
}
